# -*- coding: UTF-8 -*-
# @author: rain_lane
# @email: 1172965673@qq.com
# @file: _13.py
# @time: 2021/6/12 14:29
# @Software: PyCharm


import requests
import re


headers = {
    'Cookie': 'sessionid=9lr7m2yit13derb2dua5utdr1e6bhq5v;221',
    'User-Agent': 'yuanrenxue.project'
}
session = requests.Session()
url = 'http://match.yuanrenxue.com/match/13'
res = session.get(url=url, headers=headers).text
pattern = re.compile(r"\('(.*?)'\)")
cookie = ''.join(pattern.findall(res))
session.cookies.update({cookie.split("=")[0]: cookie.split("=")[1]})
num = list()

for i in range(1, 6):
    param_data = {
        'page': i,
    }
    headers = {
        'User-Agent': 'yuanrenxue.project'
    }
    res = session.get(
        url='http://match.yuanrenxue.com/api/match/13',
        headers=headers,
        params=param_data).json()
    for i in res['data']:
        num.append(i['value'])

print(sum(num))
